import request from "./http";
const ApiHome = {
    getCategory() {
      return request({
        url:"/home/category",
        method:"get",
    })  //获取一级分类
    },
  //删除一级分类
    delCategory(Id) {
      return request({
        url:`/home/category${Id}`,
        method:"post",
    }) 
    },
  // 更新一级分类
    updateCategory(parms) { 
      return request({
        url:`/home/category/update`,
        method:"post",
        parms
    }) 
    },
  // 添加一级分类
    addCategory(params) {
      return request({
        url:`/home/category/add`,
        method:"post",
        params
    }) 
    },
    
  //获取二级分类
    getCategorysub(Id) {
      return request({
        url:`/home/categorysub?category_id=${Id}`,
        method:"get",
    }) 
    },
    // 删除二级分类
    delCategorysub(Id) {
      return request({
        url:`/home/catgorysub/delete/${Id}`,
        method:"post",
    }) 
      },
      // 更新一级分类
      updateCategorysub(parms) {
        return request({
          url:`/home/catgorysub/update`,
          method:"post",
          parms
      }) 
      },
      // 添加一级分类
      addCategorysub(params) {
        return request({
          url:`/home/catgorysub/add`,
          method:"post",
          params
      }) 
       
      },
      //获取列表的数据
      getcollectList(params){
        return request({
          url:`/home/collectList`,
          method:"get",
          params
      }) 
      }

  };
  
  export default ApiHome;